Optimal. Leaf size=211 \[ \frac {2 a b \, _2F_1\left (\frac {1}{2},-\frac {n p}{2};\frac {1}{2} (2-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f n p \sqrt {\sin ^2(e+f x)}}-\frac {\left (b^2 n p+a^2 (1+n p)\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1-n p);\frac {1}{2} (3-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f \left (1-n^2 p^2\right ) \sqrt {\sin ^2(e+f x)}}+\frac {b^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 211, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {4033, 3873,
3857, 2722, 4131} \begin {gather*} -\frac {\left (a^2 (n p+1)+b^2 n p\right ) \sin (e+f x) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1-n p);\frac {1}{2} (3-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n}{f \left (1-n^2 p^2\right ) \sqrt {\sin ^2(e+f x)}}+\frac {2 a b \sin (e+f x) \, _2F_1\left (\frac {1}{2},-\frac {n p}{2};\frac {1}{2} (2-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n}{f n p \sqrt {\sin ^2(e+f x)}}+\frac {b^2 \tan (e+f x) \left (c (d \sec (e+f x))^p\right )^n}{f (n p+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 3857
Rule 3873
Rule 4033
Rule 4131
Rubi steps
\begin {align*} \int \left (c (d \sec (e+f x))^p\right )^n (a+b \sec (e+f x))^2 \, dx &=\left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{n p} (a+b \sec (e+f x))^2 \, dx\\ &=\left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{n p} \left (a^2+b^2 \sec ^2(e+f x)\right ) \, dx+\frac {\left (2 a b (d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{1+n p} \, dx}{d}\\ &=\frac {b^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)}+\frac {\left (2 a b \left (\frac {\cos (e+f x)}{d}\right )^{n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-1-n p} \, dx}{d}+\left (\left (a^2+\frac {b^2 n p}{1+n p}\right ) (d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{n p} \, dx\\ &=\frac {2 a b \, _2F_1\left (\frac {1}{2},-\frac {n p}{2};\frac {1}{2} (2-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f n p \sqrt {\sin ^2(e+f x)}}+\frac {b^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)}+\left (\left (a^2+\frac {b^2 n p}{1+n p}\right ) \left (\frac {\cos (e+f x)}{d}\right )^{n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-n p} \, dx\\ &=\frac {2 a b \, _2F_1\left (\frac {1}{2},-\frac {n p}{2};\frac {1}{2} (2-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f n p \sqrt {\sin ^2(e+f x)}}-\frac {\left (a^2+\frac {b^2 n p}{1+n p}\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1-n p);\frac {1}{2} (3-n p);\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f (1-n p) \sqrt {\sin ^2(e+f x)}}+\frac {b^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.51, size = 200, normalized size = 0.95 \begin {gather*} \frac {\csc (e+f x) \left (a^2 \left (2+3 n p+n^2 p^2\right ) \cos ^2(e+f x) \, _2F_1\left (\frac {1}{2},\frac {n p}{2};1+\frac {n p}{2};\sec ^2(e+f x)\right )+b n p \left (b (1+n p) \, _2F_1\left (\frac {1}{2},1+\frac {n p}{2};2+\frac {n p}{2};\sec ^2(e+f x)\right )+2 a (2+n p) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1+n p);\frac {1}{2} (3+n p);\sec ^2(e+f x)\right )\right )\right ) \sec (e+f x) \left (c (d \sec (e+f x))^p\right )^n \sqrt {-\tan ^2(e+f x)}}{f n p (1+n p) (2+n p)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.12, size = 0, normalized size = 0.00 \[\int \left (c \left (d \sec \left (f x +e \right )\right )^{p}\right )^{n} \left (a +b \sec \left (f x +e \right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n} \left (a + b \sec {\left (e + f x \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (c\,{\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^p\right )}^n\,{\left (a+\frac {b}{\cos \left (e+f\,x\right )}\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________